﻿{extend name="public:base" /}

{block name="css"}
<link href="/static/laydate/theme/default/laydate.css">{/block}

{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <div class="row search-form">
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <input placeholder="选择开始日期搜索" type="text" class="form-control form-control-lg screen-date" name="start_time" value="{:input('start_time')}" readonly="" lay-key="1">
                            </div>
                        </div>
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <input placeholder="选择结束日期搜索" type="text" class="form-control form-control-lg screen-date" name="end_time" value="{:input('end_time')}" readonly="" lay-key="1">
                            </div>
                        </div>
                        <div class="col-sm-4 m-b-sm">
                            <div class="input-group">
                                <button type="button" class="btn btn-primary btn-lg screen-btn">搜索</button>
                            </div>
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-striped">
                            <tr>
                                <th>ID</th>
                                <th>学员ID</th>
                                <th>学员姓名</th>
                                <th>课程</th>
                                <th>题干</th>
                                <th>题目</th>
                                <th>所选答案</th>
                                <th>结果</th>
                                <th>做题时间</th>
                            </tr>
                            {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{$vo.user_id}</td>
                                <td>{$vo.username}</td>
                                <td>{:getCourseTopCategory($vo.category_id)}</td>
                                <td>{$vo.question_stem}</td>
                                <td>
                                    {$vo.question.text}
                                    <br/>
                                    {if $vo.question.img}
                                    {volist name=":explode(',', $vo.question.img)" id="v"}
                                    <img src="{:getPicture($v)}" style="width: 60px; height: 60px; object-fit: cover"/>
                                    {/volist}
                                    {/if}
                                </td>
                                <td>{$vo.me_answer}</td>
                                <td>{$vo.is_true == 0 ? '错误' : '正确'}</td>
                                <td>{$vo.create_time|timeFormat}</td>
                            </tr>
                            {/volist}
                        </table>
                        {if !empty($list)}{$list->render()}{/if}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name='js'}
<script src="/static/laydate/laydate.js"></script>
<script>
    laydate.render({
        elem: '.screen-date' //指定元素
    });
</script>{/block}